- breadcrumb_title _("Repository")
- page_title _("Repository")
- add_page_specific_style 'page_bundles/settings'
- @force_desktop_expanded_sidebar = true

%div{ data: { event_tracking_load: 'true', event_tracking: 'view_admin_application_settings_repository_pageload' } }

= render ::Layouts::SettingsBlockComponent.new(_('Default branch'),
  id: 'js-default-branch-name',
  expanded: expanded_by_default?) do |c|
  - c.with_description do
    = s_('AdminSettings|Set the initial name and protections for the default branch of new repositories created in the instance.')
  - c.with_body do
    = render 'default_branch'

= render ::Layouts::SettingsBlockComponent.new(_('Repository mirroring'),
  id: 'js-mirror-settings',
  expanded: expanded_by_default?) do |c|
  - c.with_description do
    = _('Configure repository mirroring.')
    = link_to _('Learn more.'), help_page_path('user/project/repository/mirror/_index.md'), target: '_blank', rel: 'noopener noreferrer'
  - c.with_body do
    = render partial: 'repository_mirrors_form'

= render ::Layouts::SettingsBlockComponent.new(_('Repository storage'),
  id: 'js-repository-storage-settings',
  testid: 'repository-storage-settings',
  expanded: expanded_by_default?) do |c|
  - c.with_description do
    = _('Configure repository storage.')
    = link_to _('Learn more.'), help_page_path('administration/repository_storage_paths.md'), target: '_blank', rel: 'noopener noreferrer'
  - c.with_body do
    = render 'repository_storage'

= render ::Layouts::SettingsBlockComponent.new(_('Repository maintenance'),
  id: 'js-repository-check-settings',
  expanded: expanded_by_default?) do |c|
  - c.with_description do
    - repository_checks_link_url = help_page_path('administration/repository_checks.md')
    - repository_checks_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: repository_checks_link_url }
    - housekeeping_link_url = help_page_path('administration/housekeeping.md')
    - housekeeping_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: housekeeping_link_url }
    = html_escape(s_('Configure %{repository_checks_link_start}repository checks%{link_end} and %{housekeeping_link_start}housekeeping%{link_end} on repositories.')) % { repository_checks_link_start: repository_checks_link_start, housekeeping_link_start: housekeeping_link_start, link_end: '</a>'.html_safe }
  - c.with_body do
    = render 'repository_check'

= render ::Layouts::SettingsBlockComponent.new(_('External storage for repository static objects'),
  id: 'js-repository-static-objects-settings',
  testid: 'repository-static-objects-settings',
  expanded: expanded_by_default?) do |c|
  - c.with_description do
    = _('Serve repository static objects (for example, archives and blobs) from external storage.')
    = link_to _('Learn more.'), help_page_path('administration/static_objects_external_storage.md'), target: '_blank', rel: 'noopener noreferrer'
  - c.with_body do
    = render 'repository_static_objects'
